runTTests <- function(data, outcome.var.names, indp.var){
  results.df <- c()
  #Set column names
  col.names <- c("outcome","mean_judge", "mean_missing_judge", "p_value")
  
  for(outcome.var in outcome.var.names){
    possibleError <- tryCatch(
      ttest <- t.test(data[[outcome.var]]~data[[indp.var]]),
      error=function(e) e
    )
    if(inherits(possibleError, "error")){
      test.row <- c(outcome.var,NA,NA,NA)
    }else{
      test.row <- c(outcome.var,
                    ttest$estimate[1], 
                    ttest$estimate[2], 
                    ttest$p.value)
    }
    #Set names
    names(test.row) <- col.names
    results.df <- rbind(results.df, test.row)
  }
  #Clean up results
  results.df <- suppressWarnings(data.frame(results.df, stringsAsFactors = F))
  names(results.df) <-  c("outcome","mean_judge", "mean_missing_judge", "p_value")
  return(results.df)
}
